<template>
  <div class="evaluate">
    <div class="header-image">
      <el-avatar :src="settings.avatarUrl + evaluate.url" size="medium" />
    </div>
    <div class="text" style="">
      <div class="name-time">
        <span>{{ evaluate.username }}</span>
        <span>{{ parseTime(evaluate.updateTime) }}</span>
      </div>
      <span class="eva-body">{{ evaluate.text }}</span>
    </div>
  </div>
</template>

<script>
import settings from '@/settings'
import { parseTime } from '@/utils'

export default {
  name: 'EvaluateInfo',
  props: {
    evaluate: {
      required: true,
      type: Object
    }
  },
  data() {
    return {
      settings
    }
  },
  methods: {
    parseTime() {
      return parseTime(this.evaluate.updateTime, '{y}.{m}.{d}\xa0\xa0{h}:{i}:{s}')
    }
  }
}
</script>

<style lang="scss" scoped>
//学生评价
.evaluate {
  display: flex;
  width: 100%;

  .header-image {
    width: 80px;
    text-align: center;
  }

  .text {
    width: 100%;
    margin-right: 20px;

    .name-time {
      display: flex;
      justify-content: space-between;
      margin-bottom: 5px;

      span {
        font-size: 14px;
        color: #999;
      }
    }

    .eva-body {
      width: 100%;
      font-size: 16px;
      line-height: 22px;
      color: #6e6e6e;
    }
  }
}
</style>
